<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
    <style>
        * {
            margin: 0;
            padding: 0;
        }
    </style>
    <title>雾化吸入</title>
    <link rel="stylesheet" type="text/css" href="css/mui.css">
    <link rel="stylesheet" type="text/css" href="css/common.css">
    <link rel="stylesheet" type="text/css" href="css/reset.css">
    <link rel="stylesheet" type="text/css" href="css/custom.css">
    <script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.3.2.js"></script>
</head>
<body>
<div id='result'></div>
<div id="app">
    <button  @click="clickWX">点击测试</button>
    <patinfo :patdata="patData"></patinfo>
    <div class="flexHC bgwhite marginT10">
        <div class="mui-switch mui-active" @click="clickSwitch">
            <div class="mui-switch-handle"></div>
        </div>
        <datetime :datetime="dateTime" @eventdata="dateTimeData($event)"></datetime>
    </div>
    <div class="flexV">
        <div v-for="item in ordList">
            <div class="bgwhite marginT10">
                <span class="mui-badge mui-badge-primary ">{{ item.DisposeStatDesc }}</span>
            </div>
            <div class="bgwhite" v-for="item2 in item.ArcimDescList">
                <div>{{item2.ArcimDesc}}</div>
                <div>{{item2.DoseQtyUnit}} {{item2.PhOrdQtyUnit}}</div>
            </div>
        </div>
    </div>
</div>
</body>
<script src="js/vue.min.js"></script>
<script src="js/mui.min.js"></script>
<script src="js/util.js"></script>
<script src="./components/patinfo.js"></script>
<script src="./components/datetime.js"></script>
<script>
    new Vue({
        el: '#app',
        data: {
            patData: {
                "PatAge": "24岁",
                "PatDiag": "急性上呼吸道感染",
                "PatName": "杨阳",
                "PatRegNo": "0000000092",
                "PatSex": "女"
            },
            dateTime: "",
            "ordList": [
                {
                    "ArcimDescList": [
                        {
                            "ArcimDesc": "氯化钠注射液[[塑瓶][0.9%×10ml]",
                            "DoseQtyUnit": "1 支",
                            "PhOrdQtyUnit": "12 支"
                        },
                        {
                            "ArcimDesc": "注射用青霉素钠[80万单位]",
                            "DoseQtyUnit": "160 万单位",
                            "PhOrdQtyUnit": "24 支"
                        },
                        {
                            "ArcimDesc": "静脉推注及材料费",
                            "DoseQtyUnit": " 万单位",
                            "PhOrdQtyUnit": "12 项/次"
                        }
                    ],
                    "CreateDateTime": "2019-11-27 20:54:41",
                    "DisposeStatDesc": "需处理临嘱",
                    "DoseQtyUnit": " 万单位",
                    "EpisodeID": "24957701",
                    "Notes": "  ",
                    "OeoriId": "25186794||53||5",
                    "PhOrdQtyUnit": "总量12 项/次",
                    "PhcinDesc": "静脉推注",
                    "auditDateTime": "",
                    "auditUser": "",
                    "desDateTime": "",
                    "desUser": "",
                    "OrdState": "已执行"
                },
                {
                    "ArcimDescList": [
                        {
                            "ArcimDesc": "氯化钠注射液[[塑瓶][0.9%×10ml]",
                            "DoseQtyUnit": "1 支",
                            "PhOrdQtyUnit": "12 支"
                        },
                        {
                            "ArcimDesc": "注射用青霉素钠[80万单位]",
                            "DoseQtyUnit": "160 万单位",
                            "PhOrdQtyUnit": "24 支"
                        },
                        {
                            "ArcimDesc": "静脉推注及材料费",
                            "DoseQtyUnit": " 万单位",
                            "PhOrdQtyUnit": "12 项/次"
                        }
                    ],
                    "CreateDateTime": "2019-11-27 20:54:41",
                    "DisposeStatDesc": "需处理临嘱",
                    "DoseQtyUnit": " 万单位",
                    "EpisodeID": "24957701",
                    "Notes": "  ",
                    "OeoriId": "25186794||53||6",
                    "PhOrdQtyUnit": "总量12 项/次",
                    "PhcinDesc": "静脉推注",
                    "auditDateTime": "",
                    "auditUser": "",
                    "desDateTime": "",
                    "desUser": ""
                }
            ]
        },
        watch: {},
        created() {
            this.dateTime = $getNowFormatDate().substring(0, 16)
        },
        mounted() {
            mui.init()
        },
        methods: {
            clickWX() {
                //微信相关API
                wx.miniProgram.postMessage({data: 'foo'})
                // wx.miniProgram.postMessage({ data: {foo: 'bar'} })
                console.log(window.__wxjs_environment === 'miniprogram') // true
                wx.miniProgram.getEnv(function (res) {
                    console.log(res.miniprogram)
                })
                wx.miniProgram.navigateTo({url: '/index/index'})
            },
            dateTimeData(e) {
                console.log("====" + e)
            },
            clickSwitch(e) {
                var val = e.target.classList.value
                //-1 不存在
                if (val.indexOf('mui-active') == -1) {
                    console.log("关")
                } else {
                    console.log("开")
                }
            }
        }
    })
</script>
</html>